Breaking a band over multiple pages.... horizontally

Hi,

Here's a tricky problem I've been having, and I'm hoping there's a good solution for it.

Basically I want to report a dataset (TTable), but I don't know yet how many columns it will have when designing the report. If there are more columns than will fit on one page, it needs to break into a new page. First across, then down. Initially I used the Cross-table as in the example. This does just that, but I found it limiting in other areas. I.e. you cannot access/alter individual columns, also I would like to do more with totals and averages. These are things you can do with normal bands.

So I then wrote some code to fill a Master Data Band manually with columns (C++).
  TfrxMasterData* bandData = dynamic_cast<TfrxMasterData*>( frxReport->FindObject( "TableData" ) );
  if( bandData )
  {
    bandData->Clear();

    TfrxMemoView* memoData;
    for( int i = 0; i < frxDBDataset->DataSet->Fields->Count; i++ )
    {
      memoData = new TfrxMemoView( bandData );
      memoData->CreateUniqueName();
      // connect to data
      memoData->DataSet = frxDBDataset;
      memoData->DataField = frxDBDataset->DataSet->Fields->Fields[i]->FieldName;
      memoData->SetBounds( i * fr1cm * 5.0, 0, fr1cm * 5.0, fr1cm * 0.5 );
      // adjust the text to the right object???s margin
      memoData->HAlign = haRight;
    }
  }

  frxReport->ShowReport( true );

This works, but columns outside the page width will simply not display. After playing around with the setting I found no way to make it break automatically.
I could add another band after the current one with the extra columns, but this would result in "down then across" and I'd like it the other way around.

Is there some code that I can write to get a similar breaking behaviour as in the Cross-table? Right now I have no idea how to do it. I looked into how the Cross-table accomplishes it and kind of understand, but do not know how to apply this to a Master Data Band.

If anyone can point me in the right direction... thanks!

Comments

  • edited 1:38AM
    I guess no-one knows... Another question then.

    Is it possible to address separate columns (memos) in a CrossView?

    For instance, I would like the text in the second column to be left-aligned and the third one right-aligned.

    Thanks!
  • gordkgordk St.Catherines On. Canada.
    edited 1:38AM
    yes you can see the usermanual on crosstabs Managing a cross-table from the script.
    btw across then down is a boolean property and can be set.

  • edited February 2009
    Hi, I did read the manual but I cannot find anything in there how to manage separate columns from code. One can only access the "global" memo for the header columns and then one memo that represents all normal columns. Hence my question above. I don't see how I could do the following: "For instance, I would like the text in the second column to be left-aligned and the third one right-aligned."

    I am aware of the PrintAcrossThenDown property, but I was wondering if the same could be accomplished for regular Data bands >
  • gordkgordk St.Catherines On. Canada.
    edited 1:38AM
    when working with regular data bands.
    down across is accomplished by dividing design page into columns.
    across down by setting the band's no of columns and column gap.
    you can also control output of objects in the obp event by using the engineobject and setting the curx cury props.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.